# -*- coding:utf-8 -*-
# @FileName  :player.py
# @Time      :2022/12/20 21:10
# @Author    :凉柠
# @E-main    :1075090027@qq.com

from django.db import models
from django.contrib.auth.models import User


class Player(models.Model):
    user = models.OneToOneField(User,on_delete=models.CASCADE)  # 当我们user删除时，与user关联的player会一块删掉
    photo = models.URLField(max_length=256,blank=True)          # 添加图像
    openid = models.CharField(default="",max_length=50,blank=True,null=True)
    score = models.IntegerField(default=1500)

    def __str__(self):
        return str(self.user)
